package proj2501.util;

import java.awt.Dimension;

import javax.swing.JTextField;

public class SelectableLabel extends JTextField {
	public SelectableLabel(String text) {
		super(text);
		construct();
	}
	public SelectableLabel() {
		construct();
	}
	
	private void construct() {
		setEditable(false);
		setBorder(null);
		updateMaximumSize();
		setFocusable(false);
	}
	
	private void updateMaximumSize() {
		setMaximumSize(new Dimension(Integer.MAX_VALUE, getPreferredSize().height));
	}
	
	@Override
	public void setText(String t) {
		super.setText(t);
		updateMaximumSize();
	}
}
